# -*- coding: utf-8 -*-
"""
img & label 匹配检查
"""


import matplotlib.pyplot as plt

anchors = {
        'crowdai1': '0.36,0.56, 2.72,3.81, 0.83,0.97, 4.81,6.59, 1.498,1.899',
        'crowdai2': '1.57,2.21, 4.8,6.62, 0.44,0.798, 2.96,3.457, 1.0,1.134',
        'coco': '0.432,0.806, 1.315,2.654, 2.680,6.960, 7.810,10.161, 6.328,3.778',
        'KITTI': '3.151,6.611, 0.391,1.212, 1.843,3.496, 0.712,5.148, 0.946,1.843',
        'KITTI_tracking': '0.378,1.218, 1.470,4.908, 0.985,1.914, 3.232,6.661, 0.483,3.779'
        }


def choose_color(seed, inter=2):
    r = seed % inter
    g = (seed//pow(inter, 1)) % inter
    b = (seed//pow(inter, 2)) % inter
    
    red = int(r/(inter-1)*255)
    green = int(g/(inter-1)*255)
    blue = int(b/(inter-1)*255)
    
    return (blue, green, red)
    
seed = 1
color_list = range(len(anchors))
for idx, dataset in enumerate(anchors):
    anchor = anchors[dataset].split(',')
    anchor = list(map(float, anchor))
    color = color_list[idx]
    for i in range(int(len(anchor)/2)):
        plt.scatter(anchor[2*i], anchor[2*i+1], c=color, s=9, marker='o')
plt.show()
